package com.jeespring.designpattern.abstractfactory;

/**
 * @Title: FactoryExample
 * @Description:
 * @Author 张朝阳
 * @Date 2021/1/3 14:57
 */
public class FruitFactory extends AbstractFactory{

    public Fruit getFruit(String name){
        if ("苹果".equals(name)){
            return new Apple();
        }else if ("香蕉".equals(name)){
            return new Banana();
        }else if ("橙子".equals(name)){
            return new Orange();
        }else {
            return null;
        }
    }

    @Override
    public Vegetable getVegetable(String vegetableName) {
        return null;
    }
}
